package edu.spec.lyq.week09.class2.home.work1;

import java.util.List;

/**
 * \* User: 11028
 * \* Date: 2018/10/27
 * \* Time: 15:04
 * \* Description:3、设计狗类Dog，继承了Animal类，实现了IPet接口
 * 成员属性，无
 * 构造方法，自行设计
 * 成员方法，自行设计
 */
public class Dog extends Animal implements IPet {
    @Override
    public void cry() {
        for( int i = 0 ; i < this.getSounds().size() ; i++) {
            System.out.println(this.getName() + " :叫声是" + this.getSounds().get(i));
        }
    }

    public Dog() {
    }

    public Dog(String name, List sounds, List foods) {
        super(name, sounds, foods);
    }
    public void eat(){

        for( int i = 0 ; i < this.getFoods().size() ; i++) {
            Food food = (Food)this.getFoods().get(i);
            System.out.println(this.getName() + "吃" + food.getName());
        }
    }
}
